<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><% model(2); %></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="config.js"></script>
<script type="text/javascript" src="general.js"></script>
<script type="text/javascript">
    function get_syscmd_out(xhr)
    {
        var url = "http://"+window.location.host+"/syscmd_out.asp";
		var ifrm = document.getElementById("outIframe");
		ifrm.src=url;
    }
    function onfail()
    {
		var ifrm = document.getElementById("outIframe");
		ifrm.src="";
        self.close();
    }

    function show_result(xhr)
    {
        var str=xhr.responseText;
        document.form.result.value=str;
    }

    function performQuery(query){
        var frm=document.form;

        // var str="state_modem "+frm.port.value+" "+query;
        var str="state_modem "+frm.wan_modem_usbloc.value+"."+frm.wan_modem_pui.value+" "+query;
        var url=getCmdExecUrl( window.location.host, str );
        getHTTPRequest( url, get_syscmd_out );

        return false;
    }
    function performQueryUSSD(){
        var frm=document.form;
        performQuery("r "+frm.ussd.value);
        return false;
    }

	window.changeUSBparams = function (value)
	{
	//value is associated array
		var frm=document.form;
		if(value){
			frm.wan_modem_usbloc.value = value.loc;
			frm.wan_modem_pui.value = value.ui;
		}
	}
</script>

</head>
<body>
<form onsubmit="return performQueryUSSD();" name="form" id="form">
<input type="hidden" name="action_mode" value="" />

<table class="main">
<thead>
<tr>
<td>Status &amp; Log - 3G/CDMA Modem</td>
</tr>
</thead>

<tr><td>
<table class="sect">
<tr>
<th title="Select parameters for connected USB modem">View connected modems</th>
<td><input type="button" value="View" onclick="window.open('devpath_select_form.asp','Select_devpath','width=800,height=200,left=150,top=200,scrollbars=1')" /></td>
</tr>
<tr>
<th title="USB device location in USB tree. Press View button or see Status &amp; Log -> Diagnostic Info -> USB devfs Devices and find the ID in the second column (eg 1.1.0). If blank, use default.">USB device location ID:</th>
<td><input type="text" maxlength="256" class="content_input_fd" size="32" name="wan_modem_usbloc" value="<% nvram_get("wan0_modem_usbloc"); %>" onkeypress="return is_string(event, this)" onblur="validate_string(this)" /></td>
</tr>
<tr>
<th title="This field allows you to specify user interface port manually. If Autodetect device option is enabled, the router will define it automatically.">User interface port:</th>
<td><input type="text" maxlength="256" class="content_input_fd" size="32" name="wan_modem_pui" value="<% nvram_get("wan0_modem_pui"); %>" onkeypress="return is_string(event, this)" onblur="validate_string(this)" /></td>
</tr>
<tr>
<th title="This field is for entering AT command or USSD query">AT command or USSD query:</th>
<td><input type="text" maxlength="256" class="content_input_fd" name="ussd" value="<% nvram_get("ussd_query"); %>" onkeypress="return is_string(event, this)" onblur="validate_string(this)" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" value="Send" /></td>
</tr>
<tr>
<td colspan="2" style="padding:0;"><iframe id="outIframe" width="99%" src=""></iframe></td>
</tr>
</table>
</td></tr>

</table>
</form>
<pre></pre>
</body>
</html>
